#coding:utf-8
import pickle
#f = open('fa.txt','wb') #写二进制模式
f = open('fa.txt','ab') #追加写 二进制模式
dic = {1:'aaa',2:'bbb'}
pickle.dump(dic,f)
f.close()